print(set('letters'))
print(set(['Dasher', 'Dancer', 'Prancer', 'Mason-Dixon']))
print(set(('Ummagumma', 'Echoes', 'Atom Heart Mother')))
print(set({'apple':'red','orange':'orange','cherry':'red'})) #  It only keep the keys; Values are thrown away

# Get length by `len()`
s = set((1,2,3,'apple'))
print(len(s))

# add()
s.add('orange')
print(s)

# remove()
s.remove(1)
print(s)

# for-in
for i in s:
    print(i)

# Test with `in`
print('grapes' in s)
print(3 in s)

print('1------')
drinks = {
    'martini': {'vodka', 'kahlua'},
    'black russian': {'vodka', 'kahlua'},
    'white russian': {'cream', 'kahlua', 'vodka'},
    'manhattan': {'rye', 'vermouth', 'bitters'},
    'screwdriver': {'orange juice', 'vodka'}
    }
for name, contents in drinks.items():
    if 'vodka' in contents:
        print(name)
print('2------')

# & intersection
for name, contents in drinks.items():
    if contents & {'vermouth', 'orange juice'}: # To find any drink that contains vermouth or juice
        print(name)

print('3------')
for name, contents in drinks.items():
    if 'vodka' in contents and not contents & {'vermouth', 'orange juice'}:
    # Any drink that contains vodka but no vermouth or orange juice
        print(name)

a = {1,2}
b = {2,3}
print(a&b)
print(a.intersection(b))

# | union
print('4------')
print(a|b)
print(a.union(b))

# - difference
print('5------')
print(a-b)
print(b-a)
print(a.difference(b))

# ^ symmetric difference
print('6------')
print(a^b)
print(a.symmetric_difference(b))
print(b.symmetric_difference(a))

# <= subset
print('7------')
print(a<b)
print(a.issubset(b))
c = {2}
print(c<b)

# < proper subset

# >= superset

# > proper superset
